]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Only show close button on messages that can be cleared
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 11 Mar 2015 21:33:20 +0000 (22:33 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Mar 2015 16:10:11 +0000 (17:10 +0100)
Currently closing all messages is subtly different from clearing
a section, which is confusing. Start making the behavior more
predictable by only showing a close button in the message when
the section's clear button would remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=746027

js/ui/calendar.js

index e8567201100625702fa80bfdb65cc2547580423a..af349665b2ccde6a1822c6fce42ce6089e6e5bbb 100644 (file)
@@ -1137,13 +1137,13 @@ const Message = new Lang.Class({
         }
     },
 
-    canClear: function() {
+    canClose: function() {
         return true;
     },
 
     _sync: function() {
         let hovered = this.actor.hover;
-        this._closeButton.visible = hovered;
+        this._closeButton.visible = hovered && this.canClose();
         this._secondaryBin.visible = !hovered;
     },
 
@@ -1206,7 +1206,7 @@ const NotificationMessage = new Lang.Class({
         this.setUseBodyMarkup(n.bannerBodyMarkup);
     },
 
-    canClear: function() {
+    canClose: function() {
         return !this.notification.resident;
     },
 
@@ -1376,7 +1376,7 @@ const MessageListSection = new Lang.Class({
 
     clear: function() {
         let messages = [...this._messages.keys()].filter(function(message) {
-            return message.canClear();
+            return message.canClose();
         });
 
         // If there are few messages, letting them all zoom out looks OK
@@ -1405,7 +1405,7 @@ const MessageListSection = new Lang.Class({
 
     _canClear: function() {
         for (let message of this._messages.keys())
-            if (message.canClear())
+            if (message.canClose())
                 return true;
         return false;
     },